package com.lg.startertemplate.dao.jdbc;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.function.Function;

public interface DbHelper {

    Integer insert(String datasourceName, String sql) ;
    <T> T query(String datasourceName, String sql, Function<ResultSet, T> func) ;
    Integer update(String datasourceName, String sql) ;
    Integer delete(String datasourceName, String sql) ;
    Long count(String datasourceName, String sql) ;

    Integer createTable(String datasourceName, String sql) ;
    Boolean existTable(String datasourceName, String sql) ;
    Integer updateTable(String datasourceName, String sql) ;
    Integer deleteTable(String datasourceName, String sql) ;

    Integer createDatabase(String datasourceName, String sql) ;
    Boolean existDatabase(String datasourceName, String sql) ;
    Integer updateDatabase(String datasourceName, String sql);
    Integer deleteDatabase(String datasourceName, String sql) ;

}
